import java.util.Arrays;
import java.util.Random;

/**
 * Created with IntelliJ IDEA
 * Description:  测试各种排序方法
 * User: SEKI TOMOKI
 * Date: 2024-09-22
 * Time: 12:08
 */
public class Test {
    //查看排序耗时
    public static void testSort(int[] array) {
        int[] tmpArray = Arrays.copyOf(array, array.length);
        long startTime = System.currentTimeMillis();//通过它获取系统的时间，单位是毫秒
         Sort.selectSort(tmpArray);
        long endTime = System.currentTimeMillis();
        System.out.println("排序耗时：" + (endTime - startTime));
    }


    public static void initOrder(int[] array) {
        for(int i = 0; i < array.length; i++) {
            array[i] = array.length - i;
        }
    }

    public static void main(String[] args) {
//        int[] array = new int[10000];
//        initOrder(array);
        int[] array = {9, 1, 2, 5, 7, 4, 8, 6, 3, 5};

        //测试快速排序
        Sort.quickSortNonR(array);
        System.out.println(Arrays.toString(array));

    }
}
